using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

using DataAccess;
using DataTransferObject;
namespace Business
{
   
    public class clsQuanTriBUS:clsNhanVienBUS
    {
        // Field
        private clsNhanVienBUS nhanvienBus;
        private clsChucVuBUS chucvuBus;
        private clsBoPhanBUS bophanBus;
        private clsBangCapBUS bangcapBus;

        public clsThayDoiQuyDinhBUS ThayDoiQuyDinhBUS;
        public clsDocGiaBUS DocGiaBUS = new clsDocGiaBUS();

        // Contructors
        public clsQuanTriBUS()
        {
            this.nhanvienBus = new clsNhanVienBUS();
            this.chucvuBus = new clsChucVuBUS();
            this.bophanBus = new clsBoPhanBUS();
            this.bangcapBus = new clsBangCapBUS();

            this.ThayDoiQuyDinhBUS = new clsThayDoiQuyDinhBUS();
        }
       
        #region Methods

        public DataTable LayDanhSachNhanVien()
        {
            try
            {
                return this.nhanvienBus.LayDanhNhanVien();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            
        }

        public DataTable LayChiTietThongTinNhanVien()
        {
            try
            {
                return this.nhanvienBus.LayThongTinNhanVien();
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }


        public DataTable TimThongTinNhanVien(clsNhanVienDTO obj)
        {
            try
            {
                return this.nhanvienBus.TimKiemMotNhanVien(obj);
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

        public DataTable LayThongTinChucVu()
        {
            try
            {
                return this.chucvuBus.DanhSachChucVu();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public DataTable LayThongTinBoPhan()
        {
            try
            {
                return this.bophanBus.DanhSachBoPhan ();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }


        public DataTable LayThongTinBangCap()
        {
            try
            {
                return this.bangcapBus.DanhSachBangCap ();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }


        public NhanVienBusResult KiemTraRong(clsNhanVienDTO obj)
        {

            if ((obj.HoTen == ""))
                return NhanVienBusResult.HOTENERROR;
            if ((obj.GioiTinh == ""))
                return NhanVienBusResult.GIOITINHERROR;
            if ((obj.TenDangNhap == ""))
                return NhanVienBusResult.TENDANGNHAPERROR;
            if ((obj.MatKhau == ""))
                return NhanVienBusResult.MATKHAUERROR;
            if ((obj.MaBP == ""))
                return NhanVienBusResult.BANGCAPERROR;
            if ((obj.MaCV == ""))
                return NhanVienBusResult.CHUCVUERROR;
            if ((obj.MaBP == ""))
                return NhanVienBusResult.BOPHANERROR;
            return NhanVienBusResult.OK;
        }





        public NhanVienBusResult ThemMotNhanVien(clsNhanVienDTO obj)
        {
            return this.nhanvienBus.ThemNhanVien(obj); 
        }

        public NhanVienBusResult SuaMotNhanVien(clsNhanVienDTO obj)
        {
            return this.nhanvienBus.SuaNhanVien(obj);
        }

        public NhanVienBusResult XoaMotNhanVien(clsNhanVienDTO obj)
        {
            return this.nhanvienBus.XoaNhanVien(obj);
        }

       
        #endregion
    }
}
